package com.education.wisdom.service.impl;

import java.util.List;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.JrPaperQueRelationMapper;
import com.education.wisdom.pojo.JrPaperQueRelation;
import com.education.wisdom.service.IJrPaperQueRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 试卷试题关联 服务层实现
 *
 * @author d
 * @date 2020-08-07
 */
@Service
public class JrPaperQueRelationServiceImpl implements IJrPaperQueRelationService {

    @Autowired
    private JrPaperQueRelationMapper jrPaperQueRelationMapper;

    /**
     * 查询试卷试题关联信息
     *
     * @param paperId 试卷试题关联ID
     * @return 试卷试题关联信息
     */
    @Override
    public JrPaperQueRelation selectJrPaperQueRelationById(Integer paperId) {
        return jrPaperQueRelationMapper.selectJrPaperQueRelationById(paperId);
    }

    /**
     * 查询试卷试题关联列表
     *
     * @param jrPaperQueRelation 试卷试题关联信息
     * @return 试卷试题关联集合
     */
    @Override
    public List<JrPaperQueRelation> selectJrPaperQueRelationList(JrPaperQueRelation jrPaperQueRelation) {
        return jrPaperQueRelationMapper.selectJrPaperQueRelationList(jrPaperQueRelation);
    }

    /**
     * 新增试卷试题关联
     *
     * @param jrPaperQueRelation 试卷试题关联信息
     * @return 结果
     */
    @Override
    public int insertJrPaperQueRelation(JrPaperQueRelation jrPaperQueRelation) {
        return jrPaperQueRelationMapper.insertJrPaperQueRelation(jrPaperQueRelation);
    }

    /**
     * 修改试卷试题关联
     *
     * @param jrPaperQueRelation 试卷试题关联信息
     * @return 结果
     */
    @Override
    public int updateJrPaperQueRelation(JrPaperQueRelation jrPaperQueRelation) {
        return jrPaperQueRelationMapper.updateJrPaperQueRelation(jrPaperQueRelation);
    }

    /**
     * 删除试卷试题关联对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteJrPaperQueRelationByIds(String ids) {
        return jrPaperQueRelationMapper.deleteJrPaperQueRelationByIds(Convert.toStrArray(ids));
    }
}